class Cal {


	public static int[][] generateRandomMatrix(int row , int col) {
		
		int[][] matrix = new int[row][col];
		for(int i=0;i<matrix.length;i++)
			for(int j=0;j<matrix[i].length;j++)
				matrix[i][j] = (int)(Math.random()*10);
		return matrix;
	}
	public static void printMatrix(int[][] matrix) {
		
		
		for(int i=0;i<matrix.length;i++) {
			for(int j=0;j<matrix[i].length;j++)
					System.out.print(matrix[i][j]+" ");
			System.out.println();
		}
	}
	public static int[][] addMatrix(int[][] matX , int[][] matY) {
		
		
		int[][] result = new int[matX.length][matX[0].length];
		for(int i=0;i<matX.length;i++) 
			for(int j=0;j<matY[i].length;j++)
					result[i][j] = matX[i][j] + matY[i][j];
		return result;
		
	}
	
	}